import * as Router from 'koa-router';
// import { IRouterContext } from '../core/IRouterContext';
import { IRouterContext } from 'koa-router';
import qrenService from '../service/QrenService';
const motorCtr: Router = require('koa-router')();
motorCtr.prefix('/api')
import loginUtil from './../core/LoginUtils';


 /**
  * 客户确认查询
  * deliveryId : H052609 - H052618 H052617 H052616 H052615
  */
motorCtr.post('/motor/qren_query', async (ctx: IRouterContext, next: any) => {

   console.log(' 客户确认查询接口__________________');
   let authorization :any = ctx.header.authorization;
  //  let res :any = ctx.request.body;
  let rq: any = ctx.request
  let data = rq.body;
   let result = await qrenService.qren_query(data,authorization);

   ctx.status = 200;
   ctx.body = result;

   await next()

})

/**
 * b2b
 * 客户确认收货接口
 */
motorCtr.post('/motor/qren_sub', async (ctx: IRouterContext, next: any) => {

   console.log(' 客户确认收货接口__________________');
   let authorization :any = ctx.header.authorization;
  //  let res :any = ctx.request.body;
  let rq: any = ctx.request
  let data = rq.body;
   let result = await qrenService.qren_sub(data,authorization);

   ctx.status = 200;
   ctx.body = result;

   await next()

})


export default motorCtr;